package com.zl.learning.webservice.service;

import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

public class CxfService {
    public static void main(String[] args) {
        System.out.println("web Service start");
        HelloWorldImpl implementor = new HelloWorldImpl();
        String address="http://127.0.0.1:81/helloWorld";
        JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean();
        factoryBean.setAddress(address); //设置暴露地址
        factoryBean.setServiceClass(HelloWorld.class); //接口类
        factoryBean.setServiceBean(implementor); //设置实现类
        factoryBean.create();
        System.out.println("web Service started");
    }
}
